package produce.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jms.connection.JmsTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;

import javax.jms.ConnectionFactory;

/**
 * @author xiaohong
 * @version 1.0
 * @date 2021/11/14 0014 19:59
 * @description ActiveMQ配置类
 */
@Configuration
public class ActiveMQConfig {

    /**
     * 添加JMS事务管理器
     */
    @Bean
    public PlatformTransactionManager creatPlatformTransactionManager(ConnectionFactory connectionFactory){
        return new JmsTransactionManager(connectionFactory);
    }

}
